class CreateMaterials < ActiveRecord::Migration
  def self.up
    create_table :materials do |t|
      t.references :style
      t.string :name,:limit=>20
      t.string :sn,:limit=>20
      t.string :image_url
      t.string :back_image_url
      t.string :detail_image_url1
      t.string :detail_image_url2
      t.decimal :price,:precision => 8, :scale => 2, :default => 0
      t.text :description
      t.integer :sort_order,:limit=>2
      t.boolean :active,:default=>true
      t.timestamps
      t.timestamps
    end
  end

  def self.down
    drop_table :materials
  end
end
